package com.jeesite.modules.dataScreen.service;

import cn.hutool.core.collection.CollUtil;
import com.jeesite.modules.dataScreen.web.vo.FreightLogisticsVO;
import com.jeesite.modules.dataScreen.web.vo.IndustryIndexVo;
import com.jeesite.modules.dataScreen.web.vo.tabs.TabTransportTSGVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import static com.jeesite.modules.dataScreen.web.vo.IndustryIndexFun.fun;

@Service
public class TabTransportService {

    @Resource
    private IndustryIndexService industryIndexService;


    public TabTransportTSGVo getTabTransportTSG() {
        TabTransportTSGVo result = new TabTransportTSGVo();
        industryIndexService.assembly(result, false, CollUtil.toList(
                fun("旅客发送量", TabTransportTSGVo::getLkfsl),
                fun("旅客周转量", TabTransportTSGVo::getLkzzl),

                fun("江北机场运输起降架次", TabTransportTSGVo::getYhqjjb),
                fun("黔江机场运输起降架次", TabTransportTSGVo::getYhqjqj),
                fun("万州机场运输起降架次", TabTransportTSGVo::getYhqjwz),
                fun("巫山机场运输起降架次", TabTransportTSGVo::getYhqjws),
                fun("仙女山机场运输起降架次", TabTransportTSGVo::getYhqjxns),

                fun("江北机场旅客吞吐量", TabTransportTSGVo::getTtljb),
                fun("黔江机场旅客吞吐量", TabTransportTSGVo::getTtlqj),
                fun("万州机场旅客吞吐量", TabTransportTSGVo::getTtlwz),
                fun("巫山机场旅客吞吐量", TabTransportTSGVo::getTtlws),
                fun("仙女山机场旅客吞吐量", TabTransportTSGVo::getTtlxns),

                fun("江北机场不安全事件发生数量", TabTransportTSGVo::getJbbaqsj),
                fun("江北机场净空不安全事件发生数量", TabTransportTSGVo::getJbjksj)
        ));
        return result;
    }
    public FreightLogisticsVO freightLogistics() {
        FreightLogisticsVO freightLogisticsVO = new FreightLogisticsVO();
        industryIndexService.assembly(freightLogisticsVO, false, CollUtil.toList(
                fun("货运总发送量", FreightLogisticsVO::getHyzfsl),
                fun("货运总周转量", FreightLogisticsVO::getHyzzzl),
                fun("全市运输机场货邮吞吐量", FreightLogisticsVO::getQsysjchyttl),
                fun("江北机场货邮吞吐量", FreightLogisticsVO::getJbjchyttl),
                fun("万州机场货邮吞吐量", FreightLogisticsVO::getWzjchyttl),
                fun("黔江机场货邮吞吐量", FreightLogisticsVO::getQjjchyttl),
                fun("巫山机场货邮吞吐量", FreightLogisticsVO::getWsjchyttl),
                fun("仙女山机场货邮吞吐量", FreightLogisticsVO::getXnsjchyttl)
        ));

        String val = IndustryIndexVo.addAll(freightLogisticsVO.getJbjchyttl()
                , freightLogisticsVO.getWzjchyttl(), freightLogisticsVO.getQjjchyttl()
                , freightLogisticsVO.getWsjchyttl(), freightLogisticsVO.getXnsjchyttl()).toString();

        IndustryIndexVo industryIndexVo = new IndustryIndexVo("全市运输机场货邮吞吐量",val,"万吨");
        freightLogisticsVO.setQsysjchyttl(industryIndexVo);
        return freightLogisticsVO;
    }
}
